package models;

import play.db.jpa.GenericModel;

import javax.persistence.*;
import java.util.*;
/**
 * Created with IntelliJ IDEA.
 * User: Daniel
 * Date: 25/06/12
 * Time: 04:16 PM
 * To change this template use File | Settings | File Templates.
 */
@Entity(name = "hidmodelohidrologico")
public class Hidmodelohidrologico extends GenericModel {

    @Id
    @SequenceGenerator(name="hidmodelohidrologico_seq", sequenceName="hidmodelohidrologico_modhidid_seq", allocationSize=0)
    @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="hidmodelohidrologico_seq")
    private int modhidid;

    @ManyToOne
    @JoinColumn(name = "tipmodhidid")
    private Hidtipomodelohidrologico hidtipomodelohidrologico;

    private String modhidnom;
    private String modhiddesc;

    @ManyToMany
    @JoinTable(
            name="HidModHidrologicoTipoComponente",
            joinColumns = {@JoinColumn(name = "modhidid",referencedColumnName = "modhidid")},
            inverseJoinColumns = {@JoinColumn(name = "tipcompid",referencedColumnName = "tipcompid")}
    )
    private List<Hidtipocomponente> hidtipocomponentes;

    @OneToMany(mappedBy = "hidmodelohidrologico")
    private List<Hidvariablemodelohidrologico> hidvariablemodelohidrologicos;

    public Hidmodelohidrologico() {
    }


    public Hidmodelohidrologico(int modhidid, String modhidnom) {
        this.modhidid = modhidid;
        this.modhidnom = modhidnom;
    }

    public Hidmodelohidrologico(int modhidid, Hidtipomodelohidrologico hidtipomodelohidrologico, String modhidnom, String modhiddesc, List<Hidtipocomponente> hidtipocomponentes, List<Hidvariablemodelohidrologico> hidvariablemodelohidrologicos) {
        this.modhidid = modhidid;
        this.hidtipomodelohidrologico = hidtipomodelohidrologico;
        this.modhidnom = modhidnom;
        this.modhiddesc = modhiddesc;
        this.hidtipocomponentes = hidtipocomponentes;
        this.hidvariablemodelohidrologicos = hidvariablemodelohidrologicos;
    }

    public int getModhidid() {
        return this.modhidid;
    }

    public void setModhidid(int modhidid) {
        this.modhidid = modhidid;
    }
    public Hidtipomodelohidrologico getHidtipomodelohidrologico() {
        return this.hidtipomodelohidrologico;
    }

    public void setHidtipomodelohidrologico(Hidtipomodelohidrologico hidtipomodelohidrologico) {
        this.hidtipomodelohidrologico = hidtipomodelohidrologico;
    }
    public String getModhidnom() {
        return this.modhidnom;
    }

    public void setModhidnom(String modhidnom) {
        this.modhidnom = modhidnom;
    }
    public String getModhiddesc() {
        return this.modhiddesc;
    }

    public void setModhiddesc(String modhiddesc) {
        this.modhiddesc = modhiddesc;
    }

    public List<Hidtipocomponente> getHidtipocomponentes() {
        return hidtipocomponentes;
    }

    public void setHidtipocomponentes(List<Hidtipocomponente> hidtipocomponentes) {
        this.hidtipocomponentes = hidtipocomponentes;
    }

    public List<Hidvariablemodelohidrologico> getHidvariablemodelohidrologicos() {
        return hidvariablemodelohidrologicos;
    }

    public void setHidvariablemodelohidrologicos(List<Hidvariablemodelohidrologico> hidvariablemodelohidrologicos) {
        this.hidvariablemodelohidrologicos = hidvariablemodelohidrologicos;
    }
}
